Okay. So the quiz seems over. It's quite interesting when you watch the people in the class here.
We can see a lot of activity and then after a while things become a little bit more collaborative on some spaces.
But we can also see that 80% of all students answered all the questions. That's good.
So I'm quite happy.
And I'm assuming that about 240 or 250 students is the number of students actually taking the class.
Which is also a nice turnout.
So.
Oh yes, and I've seen that some of you are actually practicing with the old quiz questions.
Which is good. That's exactly what they're for.
And you may have recognized some of them.
So practicing almost always pays off and I've taken a little bit of a peek before.
And you did pretty well on this quiz.
Righto.
So we were talking about Prologue.
And the last thing we really talked about was recursive programming with Prologue.
And recursive programming is essentially all you're going to get.
We do not have, and that's probably the most important thing to understand.
We do not have variable assignment in Prologue.
Variable assignment which is really the motor of computation in imperative programming languages like Java or C or those kind of things.
Even if they call themselves object oriented.
It's basically something of the form.
You increment a variable, the contents of a variable, by something like this.
By changing the value of a variable.
That's impossible in Prologue.
We don't do that.
What we do instead is something like.
If we talk to, wait.
There we go.
Something like this which is a recursive function for addition which has a base case for zero.
If you add zero to x, this returns x.
And if you add x to s of y, then you get back s of z.
And that would be if the sum of x and y is z.
So there's two things you want to notice here.
We have a three place predicate instead of a two place function.
In a function you kind of have two inputs and one dedicated output.
That's in Prologue no longer so clear.
You could use any of the arguments for output if you wanted to.
So it's a little bit more fishy.
Or a fushant.
It's very close.
We're going to look at this a little bit.
So we're using, instead of incrementing a variable like this.
We're passing on the problem with different arguments.
We're using the arguments in the next round of back chaining.
The arguments change.
So something changes but not by us changing them but by calling with different arguments.
That's the central difference between those things.
And if you're an accomplished imperative programmer,
then you're in trouble because you have to unlearn your basic instinct.
If you have never programmed before, you're in trouble anyway because you have to learn programming.
Presenters
Zugänglich über
Offener Zugang
Dauer
01:21:50 Min
Aufnahmedatum
2024-10-29
Hochgeladen am
2024-10-30 19:59:44
Sprache
en-US